package com.flyduck.vueshop.common.mybatis.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.toolkit.Db;

import java.util.Collection;

public interface BaseMapperX<T> extends BaseMapper<T> {
    default void insertBatch(Collection<T> entities) {
        Db.saveBatch(entities);
    }

    default void updateBatchById(Collection<T> entities) {
        Db.updateBatchById(entities);
    }

    default void insertOrUpdateBatch(Collection<T> entities) {
        Db.saveOrUpdateBatch(entities);
    }


}
